﻿<!DOCTYPE html>
<html>
<head>
    <title>Groupon Helper for WebMatrix - Start Here</title>
    <link href="content/Site.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
</head>
<body>
    <div class="container">
        <div class="header">
            <img src="content/images/webx-icon.png" alt="WebMatrix" />
            <img src="content/images/groupon-logo.png" alt="Groupon Logo" class="partnerLogo" />
            <h1>
                Microsoft WebMatrix Helpers</h1>
            <h2>
                Groupon Helper - Start Here</h2>
        </div>
        <div class="content">
            <div class="navLinks">
                <a href="startHere.htm">Start Here</a> | <a href="reference.htm">Helper Reference</a>
            </div>
            <h3>
                Introduction</h3>
            <p>
                Microsoft WebMatrix provides an easy way to get started with web development, and
                together with new Razor syntax for ASP.NET Web Pages it includes everything you
                need to get your web site up, running and integrated with many other sites and networks,
                in a short period of time. The WebMatrix helpers are designed to make your life
                easier when creating web sites. They provide you a simple and consistent way of
                performing common web development tasks that otherwise would require a great deal
                of custom coding. With a few lines of code you should be able to secure your web
                site using membership, store information in Windows Azure Storage, integrate your
                site with Facebook, among others things.
            </p>
            <p>
                The <strong>Groupon Helper</strong> for WebMatrix allows you to easily add a Groupon
                badge to your WebMatrix site. When the helper is in place, it can query the Groupon
                API to get the deals for a given location, for you to display them in new, different
                ways.
            </p>
            <img src="content/images/groupon-helper.png" height="250" class="centeredImage" alt="Grupon Helper" />
            <h3>
                Getting Started in 60 Seconds</h3>
            <p>
                The helper mainly consists of a <strong>Groupon.cs</strong> file, that should be
                placed in the <strong>App_Code</strong> folder of your WebMatrix site, together
                with a Groupon folder with helper functions. To use the helper follow these steps:</p>
            <ol>
                <li>If you haven't got an Groupon account, <a href="https://www.groupon.com/users/new">
                    sign up</a> first.</li>
                <li>Once logged in, browse to the <a href="http://www.groupon.com/pages/api">Groupon
                    API Home Page</a>, click the <strong>Get My API Key</strong> button and make note
                    of its value.</li>
                <li>Add the following line to the <strong>_AppStart.cshtml</strong> page of your WebMatrix
                    site (if the file does not already exist, create it in the root of the web site), replacing the placeholders with your Groupon API key. Optionally, you can
                    also provide your referral code.
                    <pre class="code">
@{
    Groupon.Initialize(apiKey: "{your-api-key}");  
}</pre>
                </li>
                <li>In any WebMatrix page, add the following line to display the Groupon daily deal:
                    <pre class="code">
@Groupon.GetDailyDealWidget(city: "miami")
</pre>
                </li>
            </ol>
            <h3>
                Running the Gropon Helper Sample</h3>
            <p>
                Optionally, you can download a sample WebMatrix web site where you can see the helper
                in action. It contains an example of how to use the helper together with the Bing
                Maps API, to display <strong>deals over a map</strong>. To download and run it with Microsoft WebMatrix,
                follow these steps:</p>
            <ol>
                <li>Download the sample site from the helper's <a href="http://grouponhelper.codeplex.com">
                    Codeplex</a> site, Downloads section. Extract the contents and open the folder in
                    WebMatrix.</li>
                <li>Configure your Groupon API key in the <strong>_AppStart.cshtml</strong> page.</li>
                <li>Run the sample! It contains code samples and examples of each feature provided by
                    the helper.</li>
            </ol>
            <h3>
                Other Useful Resources</h3>
            <p>
                Don't miss the helper's <a href="http://www.youtube.com/watch?v=vBkoBsnt0ow">getting
                    started screencast</a>.
            </p>
            <p>
                You can find more information about the Groupon API in <a href="http://sites.google.com/site/grouponapiv2/home">
                    http://sites.google.com/site/grouponapiv2/home</a>.
            </p>
            <p>
                Learn more on WebMatrix, ASP.NET Web Pages and the Razor Syntax <a href="http://www.microsoft.com/web/webmatrix/learn/">
                    with the WebMatrix tutorials</a>.
            </p>
        </div>
        <ul class="footer">
            <li>We're always looking for <a href="mailto:webapp@microsoft.com">bugs, feedback and
                suggestions!</a></li>
            <li>&copy; 2010-2011 Microsoft Corporation. Powered by IIS Express.</li>
        </ul>
    </div>
</body>
</html>
